﻿$(document).ready(function () {
    $("#panelStdQueryHeader").attr("style", parent.$("#ASPxPageControl1_RAC").attr("style"));

    $("#panelStdQueryParam > div > div[changeborder]").each(function () {

        $(this).css("border-color", $("#panelStdQueryHeader").css("border-bottom-color")).css("border-width", "1px").css("border-style", "solid");
    });

    $("#panelStdQueryHeader").css("background-color", $(parent.parent.ASPxSplitter1_ASPxNavBar1_GC0).css("background-color")).css("padding", "3px");
});

function ResizeIFrame(contentHeight) {
    var splitStdQueryContentHeight = contentHeight - $("#panelStdQueryHeader").height();
    $("#splitStdQueryContent").height(splitStdQueryContentHeight);
    if ($("#IFrameStdQueryContent").length == 1) {
        try {
            $("#IFrameStdQueryContent")[0].contentWindow.ResizeIFrame(splitStdQueryContentHeight);
        } catch (e) { }
    }
}





function BtnSearch(s, e) {
    parent.parent.aspxLoadpanel.SetText("正在查询，请稍候。");
    parent.parent.aspxLoadpanel.Show();
    var query = GetParamValue();
    if (query.length != 0) {query += "&hfThisWidth=" + $("#hfThisWidth").val(); }
    $('#splitStdQueryContent').html("<iframe onload='parent.parent.aspxLoadpanel.Hide();' id='IFrameStdQueryContent' frameborder='0' height='100%' width='100%' scrolling='no' src='IFrameStdQueryContent.aspx" + query + "' scrolling='auto'></iframe>")

    e.processOnServer = false;
}
function BtnExport(s, e) {
    var query = "ExportPage.aspx" + GetParamValue();
    window.open(query);
    e.processOnServer = false;
}
function BtnAdd(s, e) {
    var form = $("#form1");
    parent.parent.$("#iframeContent").contents().find("#ASPxPageControl1").addTab({
        text: (form.attr("modulename") + "-新增"),
        url: form.attr("modifyurl"),
        moduleID: form.attr("moduleid")
    });
    e.processOnServer = false;
}